import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
import sibionics from '../src';
// import sibionics from '../lib/index.common';
// import sibionics from 'sibionics-ui-h5';

import App from './App';
import router from './router';
import store from './store';

import plugins from './plugins';
import { i18n } from './locale';
import example from './components/example';
import preCode from './components/pre-code';
import configTable from './components/config-table';

import './assets/styles/index';

const app = createApp(App, {
    compilerOptions: {
        isCustomElement: (tag) => tag === 't',
    },
});

app.component(example.name, example);
app.component(preCode.name, preCode);
app.component(configTable.name, configTable);

// eslint-disable-next-line
Object.keys(ElementPlusIconsVue).forEach((key) => app.component(key, ElementPlusIconsVue[key]));
// 将 $axios 注册为全局提供者
// app.provide('$axios', plugins.axios);
// app.provide('$i18n', i18n.global);
app.config.globalProperties.$axios = plugins.axios;
app.config.globalProperties.$i18n = i18n.global;

// eslint-disable-next-line
app.use(i18n).use(sibionics).use(ElementPlus).use(router).use(store).mount('#app');
